<div class="structuralLinks" xmlns="http://www.w3.org/1999/html">
  <%if(@designer!= nil) %>
      <h4 style="position:absolute; right:50px;"><%= link_to 'Description', product_path(@product,:designer_id=>@designer.id) %>  &nbsp; Photo-gallery  &nbsp; <%= link_to 'Datasheet', datasheet_product_path(@product,:designer_id=>@designer.id) %></h4>
  <%elsif(@title=="Must-have"||@title=="New")%>
      <h4 style="position:absolute; right:50px;"><%= link_to 'Description', product_path(@product,:title=>@title) %>  &nbsp; Photo-gallery  &nbsp; <%= link_to 'Datasheet', datasheet_product_path(@product,:title=>@title) %></h4>
  <%elsif(@product_type_id!=nil)%>
      <h4 style="position:absolute; right:50px;"><%= link_to 'Description', product_path(@product,:product_type_id=>@product_type_id)%> &nbsp; Photo-gallery &nbsp; <%= link_to 'Datasheet', datasheet_product_path(@product, :product_type_id=>@product_type_id) %></h4>
  <%else%>
      <h4 style="position:absolute; right:50px;"><%= link_to 'Description', product_path(@product) %>  &nbsp; Photo-gallery  &nbsp; <%= link_to 'Datasheet', datasheet_product_path(@product) %></h4>
  <%end%>
</div>

<br>

<div>
  <hr style="clear:both;"/>
  <br>
  <h1> Photogallery of <%= @product.name %>   </h1>

  <br>
  <h6> Designed by
    <% @designers.each do |designer| %>
        <%= link_to designer.name, designer_path(designer) %>
    <% end  %> <br>
    Exposed in
    <% @events.each do |event| %>
        <%= link_to event.name, event_path(event) %>
    <% end  %> <br>
    <%= link_to 'Find this product', shops_for_this_product_product_path(@product) %>
    <br>
    <br>
  </h6>

    <div class="gridList">
      <% @images.each do |image| %>
          <div class="gridBox" class="flex">

            <script src="/hbc-progetto-hypermedia-applications/app/assets/javascripts/jquery-1.10.2.min.js"></script>
            <script src="/hbc-progetto-hypermedia-applications/app/assets/javascripts/lightbox-2.6.min.js"></script>

            <%= link_to image_tag("/products/#{image.image_url}"), "/products/#{image.image_url}", :rel => "lightbox" %>


          </div>
      <% end  %>
    </div>
</div>




<!-- BACK LINKS-->

<div id="backLinkProduct">
  <div id="imageBack">
    <% if(@title=="All") %>

        <%= link_to "/products" do%>
            <%= image_tag("/back.png") %>
        <% end %>
        </div>
        <div id="textBack">
          Back to <%=@title%> products
        </div>
    <% elsif(@title=="Must-have") %>

        <%= link_to "/products?must=true" do%>
            <%= image_tag("/back.png") %>
        <% end %>
        </div>
        <div id="textBack">
          Back to <%=@title%> products
        </div>
    <% elsif(@title=="New") %>

        <%= link_to "/products?new=true" do%>
            <%= image_tag("/back.png") %>
        <% end %>
        </div>
        <div id="textBack">
          Back to <%=@title%> products
        </div>
    <% elsif(@designer!= nil) %>

        <%= link_to products_designer_path(@designer) do%>
            <%= image_tag("/back.png") %>
        <% end %>
        </div>
        <div id="textBack">
          Back to <%=@designer.name%>'s products
        </div>
    <% elsif(@product_type_id!=nil) %>

        <%= link_to products_path(:product_type_id=>@product_type_id) do%>
            <%= image_tag("/back.png") %>
        <% end %>
        </div>
        <div id="textBack">
          Back to "<%= @product_type.name %>"
        </div>
    <% end %>

    </div>